package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserPointIncrease;
import com.culturalCenter.dataCenter.mapper.user.UserPointIncreaseMapper;
import com.culturalCenter.dataCenter.service.user.UserPointIncreaseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserPointIncrease业务层接口实现类
 * @Date
 *****/
@Service
public class UserPointIncreaseServiceImpl implements UserPointIncreaseService {

    @Resource
    private UserPointIncreaseMapper userPointIncreaseMapper;

    @Override
    public PageInfo<UserPointIncrease> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userPointIncreaseMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userPointIncreaseMapper.deleteById(id);
    }

    @Override
    public Integer update(UserPointIncrease userPointIncrease) {
        return userPointIncreaseMapper.update(userPointIncrease);
    }

    @Override
    public Integer add(UserPointIncrease userPointIncrease) {
        return userPointIncreaseMapper.insert(userPointIncrease);
    }

    @Override
    public UserPointIncrease findById(String id) {
        return userPointIncreaseMapper.queryById(id);
    }

    @Override
    public List<UserPointIncrease> findAll(UserPointIncrease userPointIncrease) {
        return (List<UserPointIncrease>) userPointIncreaseMapper.queryAll(userPointIncrease);
    }

}
